<% if student.sex_id == '1'
      sex = "男"
   else
      sex = "女"
      end
%>
<table>
  <tr>
    <th>ID</th>
    <th>Name</th>
    <th>Sex</th>
    <th>Banji</th>
    <th>Edit</th>
    <th>Delete</th>
  </tr>
  <tr>
    <td><%= student.id %></td>
    <td><%= student.name %></td>
    <td><%= sex %></td>
    <td><%= Banji.where("id=?",student.banji_id).first.name %></td>
    <td><%= link_to 'Edit', :action => 'edit', :id => student %></td>
    <td><%= button_to 'Delete', { :action => 'destroy', :id => student, :confirm => "Are you sure you want to delete setting #{student.name}?"}, :method => :delete %></td> 
  </tr>  
</table>